home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 21 / AACD 21.iso / AACD / Programming / amigatalk / intuition / GadgetFlags.st < prev    next >
Encoding:
Text File  |  2001-02-28  |  1.9 KB  |  54 lines

  1. " ------------------------------------------------------------------- "
  2. " GadgetFlags Class is a Singleton class that allows the user to      "
  3. " reference Gadget Flags without having to remember their actual      "
  4. " hexadecimal values.                                                 "
  5. " ------------------------------------------------------------------- "
  6.  
  7. Class GadgetFlags :Dictionary ! uniqueInstance ! 
  8. [
  9.    privateNew ! newinstance !
  10.      newinstance <- super new.
  11.  
  12.      ^ newinstance
  13. |
  14.    new
  15.      ^ (self privateSetup)
  16. |
  17.    privateSetup
  18.      (uniqueInstance isNil)
  19.        ifTrue: [uniqueInstance <- self privateNew.
  20.  
  21.                 " Describe the highlight technique to be used:"
  22.  
  23.                 self at: #GFLG_GADGHCOMP    put: 0.
  24.                 self at: #GFLG_GADGHIGHBITS put: 2r0011. "For masking."
  25.                 self at: #GFLG_GADGHBOX     put: 1.
  26.                 self at: #GFLG_GADGHIMAGE   put: 2.
  27.                 self at: #GFLG_GADGHNONE    put: 3.
  28.  
  29.                 self at: #GFLG_GADGIMAGE    put: 4.
  30.  
  31.                 self at: #GFLG_RELBOTTOM    put: 8.
  32.                 self at: #GFLG_RELRIGHT     put: 16r10.
  33.                 self at: #GFLG_RELWIDTH     put: 16r20.
  34.                 self at: #GFLG_RELHEIGHT    put: 16r40.
  35.  
  36.                 self at: #GFLG_SELECTED     put: 16r80.
  37.  
  38.                 self at: #GFLG_DISABLED     put: 16r100.
  39.                 self at: #GFLG_TABCYCLE     put: 16r200.
  40.                 self at: #GFLG_STRINGEXTEND put: 16r400.
  41.                 self at: #GFLG_IMAGEDISABLE put: 16r800.
  42.  
  43.                 self at: #GFLG_LABELMASK    put: 16r3000. "For masking."
  44.                 self at: #GFLG_LABELITEXT   put: 0.
  45.                 self at: #GFLG_LABELSTRING  put: 16r1000.
  46.                 self at: #GFLG_LABELIMAGE   put: 16r2000.
  47.  
  48.                 self at: #GFLG_RELSPECIAL   put: 16r4000.
  49.                 self at: #GFLG_EXTENDED     put: 16r8000.
  50.                ].
  51.                 
  52.      ^ self "uniqueInstance??"
  53. ]
  54.